package com.kmzx.one.project.controller;

import com.kmzx.one.project.net.BaseResult;
import com.kmzx.one.project.others.dto.BannerInfo;
import com.kmzx.one.project.service.SimpleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "快美甄选_[ 轮播图_接口 ]")
@RestController
public class BannerController extends BaseController {

    @Autowired
    private SimpleService simpleService;

    @ApiOperation(value = "轮播图", notes = "获取所有轮播图")
    @GetMapping(value = "allBanner")
    public BaseResult findAllBanner() {
        List<BannerInfo> allBanners = simpleService.findAllBanners();
        BaseResult success = BaseResult.Builder.SUCC().initSuccData(allBanners);
        return success;
    }
}